package poo.indovina_numero;

import java.util.Scanner;

public class IndovinaNumeroGUI {

	static final int MAX = 10;
	static int indovina;

	public static boolean indovina(int numero) {

		boolean ok = false;
		indovina = (int) (Math.random() * MAX) + 1;

		if (!errato(numero)) {
			if (numero == indovina) {
				ok = true;
			}
		}

		return ok;

	}// indovina

	public static boolean errato(int numero) {
		if (numero <= 0 || numero > 10) {
			// System.out.println("dati errati");
			return true;
		}
		return false;

	}

	public static int getEsatto() {
		return indovina;
	}// getEsatto

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		System.out.println("numero:");
		int num = sc.nextInt();
		System.out.println(indovina(num));
		System.out.println(getEsatto());

	}

}
